//
//  SWSystemAPI.m
//  SWIOSLibary
//
//  Created by shaowei on 6/11/15.
//  Copyright (c) 2015 LianZhan. All rights reserved.
//

#import "SWSystemAPI.h"

@implementation SWSystemAPI

@end


#ifdef __cplusplus
extern "C" {
#endif

UIInterfaceOrientation getStatusBarOritation(){
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
    return orientation;
}

BOOL isPortrait(){
    UIInterfaceOrientation orientation = getStatusBarOritation();
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        return YES;
    }
    return NO;
}

CGRect getFixedScreenFrame(){
    CGRect mainScreenFrame = [UIScreen mainScreen].bounds;
#ifdef NSFoundationVersionNumber_iOS_7_1
    if(!isPortrait() && (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1)){
        mainScreenFrame = CGRectMake(0, 0, mainScreenFrame.size.height, mainScreenFrame.size.width);
    }
#endif
    return mainScreenFrame;
}


#ifdef __cplusplus
}
#endif


